package charpter14.lynx;

import java.util.ArrayList;
import java.util.List;

import typeinfo.factory.Factory;
import typeinfo.pets.Cat;
import typeinfo.pets.Cymric;
import typeinfo.pets.Dog;
import typeinfo.pets.EgyptianMau;
import typeinfo.pets.Gerbil;
import typeinfo.pets.Hamster;
import typeinfo.pets.Manx;
import typeinfo.pets.Mouse;
import typeinfo.pets.Mutt;
import typeinfo.pets.Pet;
import typeinfo.pets.PetCreator;
import typeinfo.pets.Pug;
import typeinfo.pets.Rat;
import typeinfo.pets.Rodent;

public class Fifteen extends PetCreator {

	public static final List<Factory<? extends Pet>> allFactories = new ArrayList<Factory<? extends Pet>>();

	// Types for random creation:
	private static final List<Class<? extends Pet>> types = new ArrayList<Class<? extends Pet>>();

	static {
		allFactories.add(new Pet.Factory());
		allFactories.add(new Dog.Factory());
		allFactories.add(new Cat.Factory());
		allFactories.add(new Rodent.Factory());
		allFactories.add(new Mutt.Factory());
		allFactories.add(new Pug.Factory());
		allFactories.add(new EgyptianMau.Factory());
		allFactories.add(new Manx.Factory());
		allFactories.add(new Cymric.Factory());
		allFactories.add(new Rat.Factory());
		allFactories.add(new Mouse.Factory());
		allFactories.add(new Hamster.Factory());
		allFactories.add(new Gerbil.Factory());
		for (Factory<? extends Pet> petFactory : allFactories) {
			types.add(petFactory.create().getClass());
		}
	}

	@Override
	public List<Class<? extends Pet>> types() {
		return types;
	}

	public static void main(String[] args) {
		System.out.println(types);
	}
}
